package com.dengqi.mymodule.activity.loader.applists;

import android.content.pm.ApplicationInfo;
import android.os.Bundle;

import com.dengqi.mymodule.BaseActivity;
import com.dengqi.mymodule.R;

import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 *
 */
public class LoaderAppsActivity extends BaseActivity implements AppListCollection.AppListCallbacks {


    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    private AppListCollection mCollection;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loader_recycler);
        ButterKnife.bind(this);

        mCollection = new AppListCollection();
        mCollection.init(LoaderAppsActivity.this, LoaderAppsActivity.this);

    }

    @Override
    public void onAppListLoad(List<ApplicationInfo> apps) {
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(new AppListAdapter(apps));
//        mCollection.destroyLoader();
    }

    @Override
    public void onAppListReset() {

    }
}
